package com.ivanceras.model;

import java.io.Serializable;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.IdentityType;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Choice implements Serializable{
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    public Long choiceID;

    @Persistent
	public String text;
    
    @Persistent
    public Long questionID;
    
	@Persistent
	public boolean isCorrect = false;
	
	/**
	 * when user choose this choice as his answer
	 */
	@NotPersistent
	public boolean isAnswer = false;
	
	public Choice(){
	}
	
	public Choice(String text,boolean isCorrect){
		this.text = text;
		this.isCorrect = isCorrect;
	}
	public String getText(){
		return text;
	}
	public void setText(String text){
		this.text = text;
	}
	public void setIsCorrect(boolean isCorrect){
		this.isCorrect = isCorrect;
	}
	public void setQuestionID(int questionID){
		this.questionID = new Long(questionID);
	}
	public void setAnswer(boolean isAnswer){
		this.isAnswer = isAnswer;
	}
}
